﻿CREATE TABLE [dbo].[LogCheckIntervalConfig] (
    [Id]               INT           IDENTITY (1, 1) NOT NULL,
    [InstanceConfigId] INT           NOT NULL,
    [LogType]          NVARCHAR (50) NULL,
    [CheckInterval]    INT           NULL,
    [LastCheck]        DATETIME      NULL,
    [LastModifiedDate] DATETIME      CONSTRAINT [DF_CheckInterval_LastModifiedDate] DEFAULT (getdate()) NOT NULL,
    CONSTRAINT [PK_CheckInterval] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_LogCheckInterval_InstanceConfig] FOREIGN KEY ([InstanceConfigId]) REFERENCES [dbo].[InstanceConfig] ([Id])
);


GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_LogCheckInterval_InstanceConfigId_LogType]
    ON [dbo].[LogCheckIntervalConfig]([InstanceConfigId] ASC, [LogType] ASC);

